Repository navigation
DEV-1275: over BLE too, report a Shimmer ready only once its connect sequence has ended - #137
Merged
JongChern merged 1 commit intoOct 23, 2026
Conversation
…equence has ended The Android HIL's connectReady found a Shimmer3R over BLE reported ready 2.7 s before its connect sequence ended, with driver 0.11.11_beta. #132 ports the driver's fix to Shimmer, the Classic class; Shimmer3BLEAndroid had the same defect, in two places: - it sent the app a CONNECTED state message as soon as the BLE notifications were on, before initialize() queued the connect sequence; - like Shimmer, it overrides the status handler, and a status reply part way through the sequence moved the state on: to SDLOGGING for a logging unit, which also sets mIsInitialised, and to CONNECTED once connected. When the notifications come on, the state is now CONNECTING. While CONNECTING, a status reply leaves the state alone. The sequence's own end, isReadyForStreaming(), reports the unit ready: SDLOGGING for a unit the status showed logging, since the callback adapter only moves CONNECTING to CONNECTED. AAPI_00006 hands a status reply to the driver's parser while CONNECTING. Without the fix the idle case reports Ready and the logging case SD Logging before the sequence ends; with it both wait for the end. Co-Authored-By: Claude Opus 5.5 <[email protected]>
JongChern
deleted the
DEV-1275_android_ble_ready_after_connect_sequence
branch
October 23, 2026 13:23
Contributor
Author
Logging connect verified too (24 Oct)
The 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DEV-1275 over BLE. #132 ports the driver's fix to
Shimmer, the Classic class. The Android HIL found the same defect inShimmer3BLEAndroid: a Shimmer3R over BLE was reported ready about 3 s before its connect sequence ended. That was with driver 0.11.11_beta, which can't fix it, becauseShimmer3BLEAndroidoverrides the code involved.The bug, in two places
onNotifyEnabled()sent the app a CONNECTED state message, beforeinitialize()had even queued the connect sequence.Shimmer, it overrides the status handler. A status reply part way through the sequence moved the state on: to SDLOGGING for a logging unit, which also setsmIsInitialised, and to CONNECTED once connected.An app that takes either as ready sends its own commands in among the rest of the connect sequence. In the Java driver, that's how a configure cut a Shimmer3's calibration dump short and left its accel NaN.
The fix
isReadyForStreaming(), reports the unit ready: SDLOGGING for a unit whose status showed it logging (the callback adapter only moves CONNECTING to CONNECTED), otherwise CONNECTED as before.Tested
AAPI_00006_BleConnectReadyAfterConnectSequenceTesthands a status reply to the driver's parser while CONNECTING. Without the fix, the idle case reports Ready and the logging case SD Logging before the sequence ends; with it, both wait for the end. A third case checks a status reply still moves the state once connected.connectReadyon s3r-2f31 (Shimmer3R, LogAndStream v1.1.22) over BLE, driver 0.11.11_beta, from an M2101K6G phone on Android 11:Not tested yet: the connect to a logging unit. 2F31 was charging over USB-C and doesn't log while plugged in. I'll test that part unplugged.
🤖 Generated with Claude Code